//类哈希表

class Solution {
public:
    bool canConstruct(string ransomNote, string magazine) {
        int temp[26]={0};
        for(char c:magazine){
            temp[c-'a']++;
        }
        for(char c:ransomNote){
            if(temp[c-'a']>0)
                temp[c-'a']--;
            else return false;
        }
        return true;
    }
};